package com.andyage.admin.service.impl;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Service;

import com.andyage.admin.dao.AdwxUserMapper;
import com.andyage.admin.service.IAdwxUserService;
import com.andyage.util.JsonContent;
import com.andyage.admin.bean.AdwxuserBean;

@Service
public class AdwxUserServiceImpl implements IAdwxUserService {
	public String CONTENT_TYPE = "text/html;charset=utf-8";
	@Resource
	private AdwxUserMapper adwxUserMapper;

	@Override
	public void queryAdwxUserByCondition(AdwxuserBean adwxUserBean, HttpServletRequest request,
			HttpServletResponse response) throws Exception {

		List<AdwxuserBean> list = adwxUserMapper.queryAdwxUserByCondition(adwxUserBean);
		int total = adwxUserMapper.queryAdwxUserCount(adwxUserBean);
		String jsonObject = JsonContent.getJsonArray(list, total);

		response.setContentType(CONTENT_TYPE);
		response.getWriter().print(jsonObject);
	}

}
